// 所有属性变为可选
interface User {
  id: number;
  name: string;
  age: number;
}

type PartialUser = Partial<User>;

//所有属性变为必填
interface OptionalUser {
  id?: number;
  name?: string;
}

type RequiredUser = Required<OptionalUser>;

 //所有属性变为只读
 type ReadonlyUser = Readonly<User>;